<?php
return array(
    '_id' => 'coreSettings',
    '_form' => array(
        'method' => 'post',
        'class' => array(),
        'accept-charset' => 'utf-8',
        'role' => 'form',
        'ajax-submit' => '#main',
        'id' => 'coreSettings',
    ),
    'driver' => array(
        'widget' => 'Select',
        'access' => array(
            'addForm' => true,
            'editForm' => true,
        ),
        'default' => 'mail',
        'label' => '默认邮件发送方式',
        'options' => [
            '' => 'SMTP代发',
            'sendmail' => 'Sendmail',
            'mail' => 'PHP Mail'
        ],
        'description' => '如果选用SMTP代发，必须设置SMTP配置',
        'error' => '',
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'send' => array(
        'label' => '发送服务器设置',
        'userOptions' => array(),
        'error' => '',
        'description' => '为不同的发送方式进行不同设置',
        'widget' => 'GroupTabs',
        'groupTabs' => array(
            'smtp' => array(
                'Group' => 'Group',
                'label' => 'SMTP',
                'userOptions' => array(),
                'error' => '',
                'description' => '',
                'field' => 'group',
                'widget' => 'Group',
                'group' => array(
                    'smtp_encryption' => array(
                        'label' => '加密方式',
                        'description' => '',
                        'error' => '',
                        'widget' => 'Select',
                        'value' => 0,
                        'default' => 'ssl',
                        'options' => array(
                            'null' => '不加密',
                            'ssl' => 'SSL加密',
                            'tls' => 'TLS加密',
                        ),
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                        ),
                    ),
                    'smtp_host' => array(
                        'label' => 'SMTP服务器',
                        'description' => '',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'placeholder' => 'smtp.gmail.com',
                            'class' => 'form-control',
                        ),
                    ),
                    'smtp_port' => array(
                        'label' => 'SMTP服务器端口',
                        'description' => '',
                        'error' => '',
                        'widget' => 'Numeric',
                        'default' => 465,
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                        ),
                    ),
                    'smtp_username' => array(
                        'label' => 'SMTP用户名',
                        'description' => '登录SMTP服务器的用户名',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                            'placeholder' => 'example@gmail.com',
                        ),
                    ),
                    'smtp_password' => array(
                        'label' => 'SMTP密码',
                        'description' => '登录SMTP服务器的密码',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                        ),
                    ),
                    'smtp_from_email' => array(
                        'label' => '发件人邮箱',
                        'description' => '显示的发件人邮箱',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                            'placeholder' => 'example@gmail.com',
                        ),
                    ),
                    'smtp_from_name' => array(
                        'label' => '发件人姓名',
                        'description' => '显示的发件人姓名',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                            'placeholder' => 'IT大叔',
                        ),
                    ),
                ),
                'validate' => array(),
                'attributes' => array(),
                'required' => false,
            ),
            'sendmailSettings' => array(
                'Group' => 'Group',
                'label' => 'Sendmail',
                'userOptions' => array(),
                'error' => '',
                'description' => '',
                'field' => 'group',
                'widget' => 'Group',
                'group' => array(
                    'sendmail ' => array(
                        'label' => 'sendmail启动命令',
                        'description' => '',
                        'error' => '',
                        'default' => '/usr/sbin/sendmail -bs',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                        ),
                    ),
                    'sendmail_from_email' => array(
                        'label' => '发件人邮箱',
                        'description' => '显示的发件人邮箱',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                            'placeholder' => 'example@gmail.com',
                        ),
                    ),
                    'sendmail_from_name' => array(
                        'label' => '发件人姓名',
                        'description' => '显示的发件人姓名',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                            'placeholder' => 'IT大叔',
                        ),
                    ),
                ),
                'validate' => array(),
                'attributes' => array(),
                'required' => false,
            ),
            'mail' => array(
                'Group' => 'Group',
                'label' => 'PHP Mail',
                'userOptions' => array(),
                'error' => '',
                'description' => '',
                'field' => 'group',
                'widget' => 'Group',
                'group' => array(
                    'mail_from_email' => array(
                        'label' => '发件人邮箱',
                        'description' => '显示的发件人邮箱',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                            'placeholder' => 'example@gmail.com',
                        ),
                    ),
                    'mail_from_name' => array(
                        'label' => '发件人姓名',
                        'description' => '显示的发件人姓名',
                        'error' => '',
                        'widget' => 'Text',
                        'validate' => array(),
                        'attributes' => array(
                            'class' => 'form-control',
                            'placeholder' => 'IT大叔',
                        ),
                    ),
                ),
                'validate' => array(),
                'attributes' => array(),
                'required' => false,
            ),
        ),
        'validate' => array(),
        'attributes' => array(),
        'required' => false,
    ),
    '_options' => array(
        'storage' => 'm.core.email',
        'module' => '系统',
        'title' => '邮件',
        'description' => '邮件发送相关设置',
    ),
);
